Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect back to edit page after using new creator/collection button #2677

Merged
merged 5 commits into from
Sep 13, 2024

Conversation

Floppy
Copy link
Collaborator

@Floppy Floppy commented Sep 13, 2024

Resolves #2461

@Floppy Floppy added the bug Something isn't working label Sep 13, 2024
@Floppy Floppy changed the title Redirect back after using new creator/collection button Redirect back to edit page after using new creator/collection button Sep 13, 2024
@Floppy Floppy merged commit 06e35bc into main Sep 13, 2024
11 checks passed
@Floppy Floppy deleted the redirect-back-from-new-creator branch September 13, 2024 12:27
@@ -204,4 +206,18 @@ def get_creators_and_collections
@creators = policy_scope(Creator)
@collections = policy_scope(Collection)
end

def set_returnable
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method set_returnable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

@@ -54,7 +54,12 @@ def edit
def create
authorize Collection
@collection = Collection.create(collection_params)
redirect_to collections_path, notice: t(".success")
if session[:return_after_new]
redirect_to session[:return_after_new] + "?new_collection=#{@collection.to_param}", notice: t(".success")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible unprotected redirect

@@ -52,7 +52,12 @@ def edit
def create
authorize Creator
@creator = Creator.create(creator_params)
redirect_to creators_path, notice: t(".success")
if session[:return_after_new]
redirect_to session[:return_after_new] + "?new_creator=#{@creator.to_param}", notice: t(".success")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible unprotected redirect

Copy link

codeclimate bot commented Sep 13, 2024

Code Climate has analyzed commit 761e9af and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 2
Security 2

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 86.8% (0.0% change).

View more on Code Climate.

truecharts-admin added a commit to truecharts/charts that referenced this pull request Sep 18, 2024
….79.0@fbe7374 by renovate (#26621)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/manyfold3d/manyfold](https://redirect.github.com/manyfold3d/manyfold)
| minor | `0.78.1` -> `0.79.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>manyfold3d/manyfold (ghcr.io/manyfold3d/manyfold)</summary>

###
[`v0.79.0`](https://redirect.github.com/manyfold3d/manyfold/releases/tag/v0.79.0)

[Compare
Source](https://redirect.github.com/manyfold3d/manyfold/compare/v0.78.1...v0.79.0)

This release sees the arrival of a long-awaited feature, the ability to
upload files into an existing model! Now you can add images, extra
files, fixed files, whatever you want. It also comes with improved
upload performance, and a load of bugfixes for some issues that have
been on the backlog for a long time!

#### What's Changed

##### ✨ New Features ✨

- Upload files into existing models by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2686
- Add file type icon to blank previews by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2685

##### 🐛 Bug Fixes 🐛

- Link tags on model page to list by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2676
- Redirect back to edit page after using new creator/collection button
by [@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2677
- Make "problem" links dark to fix contrast issues. by
[@&#8203;aneurinprice](https://redirect.github.com/aneurinprice) in
[manyfold3d/manyfold#2679
- Fix invisible tag selector border by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2684
- Fix library storage key lookup by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2691
- Remove overflowing text on image carousel buttons by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2692
- Fix bulk actions in advanced admin interface by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2693
- Send logs to stdout by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2694
- Fix redirection when viewing a page that requires login by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2697
- Make sure tag ordering is consistent by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2698
- Fix upload problems caused by Shrine config by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2703

##### 🛠️ Other Improvements 🛠️

- Improve performance and disk usage during upload processing by
[@&#8203;Floppy](https://redirect.github.com/Floppy) in
[manyfold3d/manyfold#2674

**Full Changelog**:
manyfold3d/manyfold@v0.78.1...v0.79.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44OC4wIiwidXBkYXRlZEluVmVyIjoiMzguODguMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6WyJhdXRvbWVyZ2UiLCJ1cGRhdGUvZG9ja2VyL2dlbmVyYWwvbm9uLW1ham9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

New Creator/Collection button on item edit doesn't redirect back to item after creation
1 participant